package com.yangff.entity.product.entity.productentity;

import com.yangff.entity.product.entity.Financialproduct;
import com.yangff.utils.MathUtil;

//基金
public class FundEntity extends Financialproduct {
    public FundEntity() {
        super();
        setStockType(MathUtil.getRandomNumberInIntegerRange(1,3));
    }

    private void setStockType(Integer type) {
        switch (type) {
            case 1:
                this.type = "股票型";
                this.mu = MathUtil.getRandomNumberInDoubleRange(0.05,0.25);
                this.sigma = MathUtil.getRandomNumberInDoubleRange(0.2,0.6);
                this.riskLevel = MathUtil.getRiskLevel(sigma , 0.15 , 0.6);
                break;
            case 2:
                this.type = "债券型";
                this.mu = MathUtil.getRandomNumberInDoubleRange(0.03,0.07);
                this.sigma = MathUtil.getRandomNumberInDoubleRange(0.02,0.06);
                this.riskLevel = MathUtil.getRiskLevel(sigma , 0.02 , 0.06);
                break;
            case 3:
                this.type = "混合型";
                this.mu = MathUtil.getRandomNumberInDoubleRange(0.07,0.15);
                this.sigma = MathUtil.getRandomNumberInDoubleRange(0.06,0.3);
                this.riskLevel = MathUtil.getRiskLevel(sigma , 0.06 , 0.2);
                break;
        }

    }
}
